package cn.jiyun.service;

import cn.jiyun.dao.StudentMapper;
import cn.jiyun.entity.Student;
import cn.jiyun.vo.StudentVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class StudentService {
    @Autowired(required = false)
    StudentMapper studentMapper;

    public List<StudentVo> findAll(){
        return studentMapper.findAll();
    }

    public void insertStudent(Student student){
        studentMapper.insertStudent(student);
    }

    public void updateStudent(Student student){
        studentMapper.updateStudent(student);
    }

    public void deleteStudent(Integer sid){
        studentMapper.deleteStudent(sid);
    }

    public Student findStudentById(Integer sid){
        return studentMapper.findStudentById(sid);
    }
}
